//
//  UIViewController+LSDrawer.m
//  LSDrawerExample
//
//  Created by Apple on 2018/4/17.
//  Copyright © 2018年 LuckyStrike. All rights reserved.
//

#import "UIViewController+LSDrawer.h"

@implementation UIViewController (LSDrawer)


- (LSDrawerController *)ls_drawerController {
    UIViewController *parentViewController = self.parentViewController;
    while (parentViewController != nil) {
        if([parentViewController isKindOfClass:[LSDrawerController class]]){
            return (LSDrawerController *)parentViewController;
        }
        parentViewController = parentViewController.parentViewController;
    }
    return nil;
}

@end
